import request from '@/utils/request'

// 查询
export function listGatewayManagement(query) {
  return request({
    url: '/gatewayManagement/gatewayManagement/list',
    method: 'get',
    params: query
  })
}

// 查询
export function getGatewayManagement(gatewayId) {
  return request({
    url: '/gatewayManagement/gatewayManagement/' + gatewayId,
    method: 'get'
  })
}

// 新增
export function addGatewayManagement(data) {
  return request({
    url: '/gatewayManagement/gatewayManagement',
    method: 'post',
    data: data
  })
}

// 修改
export function updateGatewayManagement(data) {
  return request({
    url: '/gatewayManagement/gatewayManagement',
    method: 'put',
    data: data
  })
}

// 删除
export function delGatewayManagement(gatewayId) {
  return request({
    url: '/gatewayManagement/gatewayManagement/' + gatewayId,
    method: 'delete'
  })
}

// 更新
export function updateMainboardData(){
  return request({
    url: '/gatewayManagement/gatewayManagement/updateMainboardData',
    method: 'post',
  })
}

// 重启
export function restartMainboard(gatewayIds) {
  return request({
    url: '/gatewayManagement/gatewayManagement/restartMainboard',
    method: 'post',
    data: gatewayIds
  })
}

//  迁移服务
export function migrationService(serialNumberIds){
  return request({
    url: '/gatewayManagement/gatewayManagement/migrationService',
    method: 'post',
    data: serialNumberIds
  })
}

